home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -screenplay- / otherstuff / inform_lib610 / grammar.h < prev    next >
Text File  |  1999-11-29  |  17KB  |  395 lines

  1. ! ----------------------------------------------------------------------------
  2. !  GRAMMAR:  Grammar table entries for the standard verbs library.
  3. !
  4. !  Supplied for use with Inform 6                         Serial number 991106
  5. !                                                                 Release 6/10
  6. !  (c) Graham Nelson 1993, 1994, 1995, 1996, 1997, 1998, 1999
  7. !      but freely usable (see manuals)
  8. ! ----------------------------------------------------------------------------
  9. !  The "meta-verbs", commands to the game rather than in the game, come first:
  10. ! ----------------------------------------------------------------------------
  11.  
  12. System_file;
  13.  
  14. Verb meta 'score'
  15.                 *                                -> Score;
  16. Verb meta 'fullscore' 'full'
  17.                 *                                -> FullScore
  18.                 * 'score'                        -> FullScore;
  19. Verb meta 'q//' 'quit' 'die'
  20.                 *                                -> Quit;
  21. Verb meta 'restore'
  22.                 *                                -> Restore;
  23. Verb meta 'restart'
  24.                 *                                -> Restart;
  25. Verb meta 'verify'
  26.                 *                                -> Verify;
  27. Verb meta 'save'
  28.                 *                                -> Save;
  29. Verb meta 'script' 'transcript'
  30.                 *                                -> ScriptOn
  31.                 * 'off'                          -> ScriptOff
  32.                 * 'on'                           -> ScriptOn;
  33. Verb meta 'noscript' 'unscript'
  34.                 *                                -> ScriptOff;
  35. Verb meta 'superbrief' 'short'
  36.                 *                                -> LMode3;
  37. Verb meta 'verbose' 'long'
  38.                 *                                -> LMode2;
  39. Verb meta 'brief' 'normal'
  40.                 *                                -> LMode1;
  41. Verb meta 'pronouns' 'nouns'
  42.                 *                                -> Pronouns;
  43. Verb meta 'notify'
  44.                 * 'on'                           -> NotifyOn
  45.                 * 'off'                          -> NotifyOff;
  46. Verb meta 'version'
  47.                 *                                -> Version;
  48. #IFNDEF NO_PLACES;
  49. Verb meta 'places'
  50.                 *                                -> Places;
  51. Verb meta 'objects'
  52.                 *                                -> Objects;
  53. #ENDIF;
  54.  
  55. ! ----------------------------------------------------------------------------
  56. !  Debugging grammar
  57. ! ----------------------------------------------------------------------------
  58.  
  59. #ifdef DEBUG;
  60. Verb meta 'trace'
  61.                 *                                -> TraceOn
  62.                 * number                         -> TraceLevel
  63.                 * 'on'                           -> TraceOn
  64.                 * 'off'                          -> TraceOff;
  65. Verb meta 'actions'
  66.                 *                                -> ActionsOn
  67.                 * 'on'                           -> ActionsOn
  68.                 * 'off'                          -> ActionsOff;
  69. Verb meta 'routines' 'messages'
  70.                 *                                -> RoutinesOn
  71.                 * 'on'                           -> RoutinesOn
  72.                 * 'off'                          -> RoutinesOff;
  73. Verb meta 'timers' 'daemons'
  74.                 *                                -> TimersOn
  75.                 * 'on'                           -> TimersOn
  76.                 * 'off'                          -> TimersOff;
  77. Verb meta 'changes'
  78.                 *                                -> ChangesOn
  79.                 * 'on'                           -> ChangesOn
  80.                 * 'off'                          -> ChangesOff;
  81. Verb meta 'recording'
  82.                 *                                -> CommandsOn
  83.                 * 'on'                           -> CommandsOn
  84.                 * 'off'                          -> CommandsOff;
  85. Verb meta 'replay'
  86.                 *                                -> CommandsRead;
  87. Verb meta 'random'
  88.                 *                                -> Predictable;
  89. Verb meta 'purloin'
  90.                 * multi                          -> XPurloin;
  91. Verb meta 'abstract'
  92.                 * noun 'to' noun                 -> XAbstract;
  93. Verb meta 'tree'
  94.                 *                                -> XTree
  95.                 * noun                           -> XTree;
  96. Verb meta 'goto'
  97.                 * number                         -> Goto;
  98. Verb meta 'gonear'
  99.                 * noun                           -> Gonear;
  100. Verb meta 'scope'
  101.                 *                                -> Scope
  102.                 * noun                           -> Scope;
  103. Verb meta 'showverb'
  104.                 * special                        -> Showverb;
  105. Verb meta 'showobj'
  106.                 *                                -> Showobj
  107.                 * multi                          -> Showobj;
  108. #endif;
  109.  
  110. ! ----------------------------------------------------------------------------
  111. !  And now the game verbs.
  112. ! ----------------------------------------------------------------------------
  113.  
  114. Verb 'take' 'carry' 'hold'
  115.                 * multi                          -> Take
  116.                 * 'off' worn                     -> Disrobe
  117.                 * multiinside 'from' noun        -> Remove
  118.                 * multiinside 'off' noun         -> Remove
  119.                 * 'inventory'                    -> Inv;
  120. Verb 'get'      * 'out'/'off'/'up'               -> Exit
  121.                 * multi                          -> Take
  122.                 * 'in'/'into'/'on'/'onto' noun   -> Enter
  123.                 * 'off' noun                     -> GetOff
  124.                 * multiinside 'from' noun        -> Remove;
  125. Verb 'pick'
  126.                 * 'up' multi                     -> Take
  127.                 * multi 'up'                     -> Take;
  128. Verb 'stand'
  129.                 *                                -> Exit
  130.                 * 'up'                           -> Exit
  131.                 * 'on' noun                      -> Enter;
  132. Verb 'remove'
  133.                 * held                           -> Disrobe
  134.                 * multi                          -> Take
  135.                 * multiinside 'from' noun        -> Remove;
  136. Verb 'shed' 'doff' 'disrobe'
  137.                 * held                           -> Disrobe; 
  138. Verb 'wear' 'don'
  139.                 * held                           -> Wear;
  140. Verb 'put'
  141.                 * multiexcept 'in'/'inside'/'into' noun
  142.                                                  -> Insert
  143.                 * multiexcept 'on'/'onto' noun   -> PutOn
  144.                 * 'on' held                      -> Wear
  145.                 * 'down' multiheld               -> Drop
  146.                 * multiheld 'down'               -> Drop;
  147. Verb 'insert'
  148.                 * multiexcept 'in'/'into' noun   -> Insert;
  149. Verb 'empty'
  150.                 * noun                           -> Empty
  151.                 * 'out' noun                     -> Empty
  152.                 * noun 'out'                     -> Empty
  153.                 * noun 'to'/'into'/'on'/'onto' noun
  154.                                                  -> EmptyT;
  155. Verb 'transfer'
  156.                 * noun 'to' noun                 -> Transfer;
  157. Verb 'drop' 'throw' 'discard'
  158.                 * multiheld                      -> Drop
  159.                 * multiexcept 'in'/'into'/'down' noun
  160.                                                  -> Insert
  161.                 * multiexcept 'on'/'onto' noun   -> PutOn
  162.                 * held 'at'/'against'/'on'/'onto' noun
  163.                                                  -> ThrowAt;
  164. Verb 'give' 'pay' 'offer' 'feed'
  165.                 * held 'to' creature             -> Give
  166.                 * creature held                  -> Give reverse
  167.                 * 'over' held 'to' creature      -> Give;
  168. Verb 'show' 'present' 'display'
  169.                 * creature held                  -> Show reverse
  170.                 * held 'to' creature             -> Show;
  171. [ ADirection; if (noun in compass) rtrue; rfalse; ];
  172. Verb 'go' 'walk' 'run'
  173.                 *                                -> VagueGo
  174.                 * noun=ADirection                -> Go
  175.                 * noun                           -> Enter
  176.                 * 'into'/'in'/'inside'/'through' noun
  177.                                                  -> Enter;
  178. Verb 'leave'
  179.                 *                                -> VagueGo
  180.                 * noun=ADirection                -> Go
  181.                 * noun                           -> Exit
  182.                 * 'into'/'in'/'inside'/'through' noun
  183.                                                  -> Enter;
  184. Verb 'inventory' 'inv' 'i//'
  185.                 *                                -> Inv
  186.                 * 'tall'                         -> InvTall
  187.                 * 'wide'                         -> InvWide;
  188. Verb 'look' 'l//'
  189.                 *                                -> Look
  190.                 * 'at' noun                      -> Examine
  191.                 * 'inside'/'in'/'into'/'through' noun
  192.                                                  -> Search
  193.                 * 'under' noun                   -> LookUnder
  194.                 * 'up' topic 'in' noun           -> Consult;
  195. Verb 'consult'  * noun 'about' topic             -> Consult
  196.                 * noun 'on' topic                -> Consult;
  197. Verb 'open' 'unwrap' 'uncover' 'undo'
  198.                 * noun                           -> Open
  199.                 * noun 'with' held               -> Unlock;
  200. Verb 'close' 'shut' 'cover'
  201.                 * noun                           -> Close
  202.                 * 'up' noun                      -> Close
  203.                 * 'off' noun                     -> SwitchOff;
  204. Verb 'enter' 'cross'
  205.                 *                                -> GoIn
  206.                 * noun                           -> Enter;
  207. Verb 'sit' 'lie'
  208.                 * 'on' 'top' 'of' noun           -> Enter
  209.                 * 'on'/'in'/'inside' noun        -> Enter;
  210. Verb 'in' 'inside'
  211.                 *                                -> GoIn;
  212. Verb 'exit' 'out' 'outside'
  213.                 *                                -> Exit;
  214. Verb 'examine' 'x//' 'watch' 'describe' 'check'
  215.                 * noun                           -> Examine;
  216. Verb 'read'
  217.                 * noun                           -> Examine
  218.                 * 'about' topic 'in' noun        -> Consult
  219.                 * topic 'in' noun                -> Consult;
  220. Verb 'yes' 'y//'
  221.                 *                                -> Yes;
  222. Verb 'no'
  223.                 *                                -> No;
  224. Verb 'sorry'
  225.                 *                                -> Sorry;
  226. Verb 'shit' 'fuck' 'damn' 'sod'
  227.                 *                                -> Strong
  228.                 * topic                          -> Strong;
  229. Verb 'bother' 'curses' 'drat' 'darn'
  230.                 *                                -> Mild
  231.                 * topic                          -> Mild;
  232. Verb 'search'
  233.                 * noun                           -> Search;
  234. Verb 'wave'
  235.                 *                                -> WaveHands
  236.                 * noun                           -> Wave;
  237. Verb 'set' 'adjust'
  238.                 * noun                           -> Set
  239.                 * noun 'to' special              -> SetTo;
  240. Verb 'pull' 'drag'
  241.                 * noun                           -> Pull;
  242. Verb 'push' 'move' 'shift' 'clear' 'press'
  243.                 * noun                           -> Push
  244.                 * noun noun                      -> PushDir
  245.                 * noun 'to' noun                 -> Transfer;
  246. Verb 'turn' 'rotate' 'twist' 'unscrew' 'screw'
  247.                 * noun                           -> Turn
  248.                 * noun 'on'                      -> Switchon
  249.                 * noun 'off'                     -> Switchoff
  250.                 * 'on' noun                      -> Switchon
  251.                 * 'off' noun                     -> Switchoff;
  252. Verb 'switch'
  253.                 * noun                           -> Switchon
  254.                 * noun 'on'                      -> Switchon
  255.                 * noun 'off'                     -> Switchoff
  256.                 * 'on' noun                      -> Switchon
  257.                 * 'off' noun                     -> Switchoff;
  258. Verb 'lock'
  259.                 * noun 'with' held               -> Lock;
  260. Verb 'unlock'
  261.                 * noun 'with' held               -> Unlock;
  262. Verb 'attack' 'break' 'smash' 'hit' 'fight' 'wreck' 'crack'
  263.      'destroy' 'murder' 'kill' 'torture' 'punch' 'thump'
  264.                 * noun                           -> Attack;
  265. Verb 'wait' 'z//'
  266.                 *                                -> Wait;
  267. Verb 'answer' 'say' 'shout' 'speak'
  268.                 * topic 'to' creature            -> Answer;
  269. Verb 'tell'
  270.                 * creature 'about' topic         -> Tell;
  271. Verb 'ask'
  272.                 * creature 'about' topic         -> Ask
  273.                 * creature 'for' noun            -> AskFor;
  274. Verb 'eat'
  275.                 * held                           -> Eat;
  276. Verb 'sleep' 'nap'
  277.                 *                                -> Sleep;
  278. Verb 'peel'
  279.                 * noun                           -> Take
  280.                 * 'off' noun                     -> Take;
  281. Verb 'sing'
  282.                 *                                -> Sing;
  283. Verb 'climb' 'scale'
  284.                 * noun                           -> Climb
  285.                 * 'up'/'over' noun               -> Climb;
  286. Verb 'buy' 'purchase'
  287.                 * noun                           -> Buy;
  288. Verb 'squeeze' 'squash'
  289.                 * noun                           -> Squeeze;
  290. Verb 'swim' 'dive'
  291.                 *                                -> Swim;
  292. Verb 'swing'
  293.                 * noun                           -> Swing
  294.                 * 'on' noun                      -> Swing;
  295. Verb 'blow'
  296.                 * held                           -> Blow;
  297. Verb 'pray'
  298.                 *                                -> Pray;
  299. Verb 'wake' 'awake' 'awaken'
  300.                 *                                -> Wake
  301.                 * 'up'                           -> Wake
  302.                 * creature                       -> WakeOther
  303.                 * creature 'up'                  -> WakeOther
  304.                 * 'up' creature                  -> WakeOther;
  305. Verb 'kiss' 'embrace' 'hug'
  306.                 * creature                       -> Kiss;
  307. Verb 'think'
  308.                 *                                -> Think;
  309. Verb 'smell' 'sniff'
  310.                 *                                -> Smell
  311.                 * noun                           -> Smell;
  312. Verb 'hear' 'listen'
  313.                 *                                -> Listen
  314.                 * noun                           -> Listen
  315.                 * 'to' noun                      -> Listen;
  316. Verb 'taste'
  317.                 * noun                           -> Taste;
  318. Verb 'touch' 'fondle' 'feel' 'grope'
  319.                 * noun                           -> Touch;
  320. Verb 'rub' 'shine' 'polish' 'sweep' 'clean' 'dust' 'wipe' 'scrub'
  321.                 * noun                           -> Rub;
  322. Verb 'tie' 'attach' 'fasten' 'fix'
  323.                 * noun                           -> Tie
  324.                 * noun 'to' noun                 -> Tie;
  325. Verb 'burn' 'light'
  326.                 * noun                           -> Burn
  327.                 * noun 'with' held               -> Burn;
  328. Verb 'drink' 'swallow' 'sip'
  329.                 * noun                           -> Drink;
  330. Verb 'fill'
  331.                 * noun                           -> Fill;
  332. Verb 'cut' 'slice' 'prune' 'chop'
  333.                 * noun                           -> Cut;
  334. Verb 'jump' 'skip' 'hop'
  335.                 *                                -> Jump
  336.                 * 'over' noun                    -> JumpOver;
  337. Verb 'dig'      * noun                           -> Dig
  338.                 * noun 'with' held               -> Dig;
  339. ! ----------------------------------------------------------------------------
  340. !  This routine is no longer used here, but provided to help existing games
  341. !  which use it as a general parsing routine:
  342.  
  343. [ ConTopic w; consult_from = wn;
  344.   do w=NextWordStopped();
  345.   until (w==-1 || (w=='to' && action_to_be==##Answer));
  346.   wn--;
  347.   consult_words = wn-consult_from;
  348.   if (consult_words==0) return -1;
  349.   if (action_to_be==##Ask or ##Answer or ##Tell)
  350.   {   w=wn; wn=consult_from; parsed_number=NextWord();
  351.       if (parsed_number=='the' && consult_words>1) parsed_number=NextWord();
  352.       wn=w; return 1;
  353.   }
  354.   return 0;
  355. ];
  356. ! ----------------------------------------------------------------------------
  357. !  Final task: provide trivial routines if the user hasn't already:
  358. ! ----------------------------------------------------------------------------
  359. #Stub TimePasses      0;
  360. #Stub Amusing         0;
  361. #Stub DeathMessage    0;
  362. #Stub DarkToDark      0;
  363. #Stub NewRoom         0;
  364. #Stub LookRoutine     0;
  365. #Stub AfterLife       0;
  366. #Stub GamePreRoutine  0;
  367. #Stub GamePostRoutine 0;
  368. #Stub AfterPrompt     0;
  369. #Stub BeforeParsing   0;
  370. #Stub PrintTaskName   1;
  371. #Stub InScope         1;
  372. #Stub UnknownVerb     1;
  373. #Stub PrintVerb       1;
  374. #Stub ParserError     1;
  375. #Stub ParseNumber     2;
  376. #Stub ChooseObjects   2;
  377. #IFNDEF PrintRank;
  378. Constant Make__PR;
  379. #ENDIF;
  380. #IFDEF Make__PR;
  381. [ PrintRank; "."; ];
  382. #ENDIF;
  383. #IFNDEF ParseNoun;
  384. Constant Make__PN;
  385. #ENDIF;
  386. #IFDEF Make__PN;
  387. [ ParseNoun obj; obj=obj; return -1; ];
  388. #ENDIF;
  389. #Default Story 0;
  390. #Default Headline 0;
  391. #IFDEF INFIX;
  392. #Include "infix";
  393. #ENDIF;
  394. ! ----------------------------------------------------------------------------
  395.